package com.piece.core.web.filter;

import org.apache.commons.lang3.tuple.Pair;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 拦截器类钩子
 */
public interface FilterHook {

    /**
     * 初始化器的过滤路径
     */
    String[] getFilterPath();

    /**
     * 初始化器的执行顺序，数值越大的初始化器越靠后执行
     */
    Integer getIndex();

    void initFilter();

    Pair<HttpServletRequest, HttpServletResponse> beforeFilter(HttpServletRequest request, HttpServletResponse response);

    void afterFilter(HttpServletRequest request, HttpServletResponse response);
}
